<template>
  <scroll-view enable-back-to-top scroll-y class="viewport">
    <!-- 我的工具 -->
    <view class="my-con my-tools">
      <view class="tit">
        <view class="text"> 充电 </view>
      </view>
      <view class="con-box">
        <view class="item" @tap="weixinSaomaUrl('/pages/index/saoma?type=chongdian')">
          <view class="img">
            <image src="/static/images/services/saoma.png" />
          </view>
          <view class="text"> 扫码充电 </view>
        </view>
        <view class="item" @tap="chargeRecord('/pages/batteryCharge/chargeRecord')">
          <view class="img">
            <image src="/static/images/chongdianjilu.png" />
          </view>
          <view class="text"> 充电记录 </view>
        </view>
        <view class="item" @tap="SendProblem('/pages/category/sendProblem')">
          <view class="img">
            <image src="/static/images/services/wentishenbao.png" />
          </view>
          <view class="text"> 问题申报</view>
        </view>
        <view class="item" @tap="SendProblem('/pages/category/sendProblem')">
          <view class="img">
            <image src="/static/images/services/shenbaojiluchaxun.png" />
          </view>
          <view class="text"> 常见问题</view>
        </view>
        <view class="item" @tap="notOpen('')">
          <view class="img">
            <image src="/static/images/services/zhengzaichongdian.png" />
          </view>
          <view class="text"> 正在充电</view>
        </view>
      </view>
    </view>

    <view class="my-con my-tools">
      <view class="tit">
        <view class="text"> 换电 </view>
      </view>
      <view class="con-box">
        <view class="item" @tap="weixinSaomaUrl('/pages/index/saoma?type=huandian')">
          <view class="img">
            <image src="/static/images/services/saoma.png" />
          </view>
          <view class="text"> 扫码换电 </view>
        </view>
        <view class="item" @tap="notOpen('/pages/batterySwap/list')">
          <view class="img">
            <image src="/static/images/huandianjilu.png" />
          </view>
          <view class="text"> 换电记录 </view>
        </view>
        <view class="item" @tap="notOpen('')">
          <view class="img">
            <image src="/static/images/services/wentishenbao.png" />
          </view>
          <view class="text"> 问题申报 </view>
        </view>
        <view class="item" @tap="notOpen('分销')">
          <view class="img">
            <image src="/static/images/services/shenbaojiluchaxun.png" />
          </view>
          <view class="text"> 常见问题 </view>
        </view>
        <view class="item" @tap="notOpen('分销')">
          <view class="img">
            <image src="/static/images/services/zhengzaihuandian.png" />
          </view>
          <view class="text"> 正在换电 </view>
        </view>
      </view>
    </view>
    <view class="my-con my-tools">
      <view class="tit">
        <view class="text"> 运维 </view>
      </view>
      <view class="con-box">
        <view class="item" @tap="notOpen('会员功能')">
          <view class="img">
            <image src="/static/images/services/huandianzhandian.png" />
          </view>
          <view class="text"> 换电站点 </view>
        </view>

        <view class="item" @tap="notOpen('分销')">
          <view class="img">
            <image src="/static/images/services/chelianghuandianxinxi.png" />
          </view>
          <view class="text"> 车辆信息 </view>
        </view>

        <view class="item" @tap="notOpen('问题申报')">
          <view class="img">
            <image src="/static/images/services/guzhangchaxun_1.png" />
          </view>
          <view class="text"> 问题申报 </view>
        </view>

        <view class="item" @tap="notOpen('常见问题')">
          <view class="img">
            <image src="/static/images/services/guzhangchaxun.png" />
          </view>
          <view class="text"> 常见问题 </view>
        </view>
        <view class="item" @tap="notOpen('领券中心')">
          <view class="img">
            <image src="/static/images/services/chongdianzhandian.png" />
          </view>
          <view class="text"> 充电站点 </view>
        </view>
      </view>
    </view>
    <!-- <view class="my-con my-tools">
      <view class="tit">
        <view class="text"> 管理 </view>
      </view>
      <view class="con-box">
        <view class="item" @tap="notOpen('会员功能')">
          <view class="img">
            <image src="/static/images/services/huandianzhandian.png" />
          </view>
          <view class="text"> 换电站点 </view>
        </view>
        <view class="item" @tap="notOpen('分销')">
          <view class="img">
            <image src="/static/images/servcies/chelianghuandianxinxi.png" />
          </view>
          <view class="text"> 车辆信息 </view>
        </view>
        <view class="item" @tap="notOpen('分销')">
          <view class="img">
            <image src="/static/images/services/guzhangshebei.png" />
          </view>
          <view class="text"> 故障设备 </view>
        </view>
        <view class="item" @tap="notOpen('分销')">
          <view class="img">
            <image src="/static/images/servcies/guzhangchaxun.png" />
          </view>
          <view class="text"> 故障查询 </view>
        </view>
        <view class="item" @tap="notOpen('分销')">
          <view class="img">
            <image src="/static/images/my-share.png" />
          </view>
          <view class="text"> 充电站点 </view>
        </view>
      </view>
    </view> -->

    <view class="my-con my-tools">
      <view class="tit">
        <view class="text"> 管理 </view>
      </view>
      <view class="con-box">
        <view class="item" @tap="normalyOpen('/management/chargeDay/index')">
          <view class="img">
            <image src="/static/images/services/meirichongdianchaxun.png" />
          </view>
          <view class="text"> 每日充电 </view>
        </view>
        <view class="item" @tap="notOpen()">
          <view class="img">
            <image src="/static/images/services/meirihuandian.png" />
          </view>
          <view class="text"> 每日换电 </view>
        </view>
        <view class="item" @tap="notOpen()">
          <view class="img">
            <image src="/static/images/services/zhandiantongjibiao.png" />
          </view>
          <view class="text"> 站点统计 </view>
        </view>
        <view class="item" @tap="notOpen()">
          <view class="img">
            <image src="/static/images/services/kehutongji.png" />
          </view>
          <view class="text"> 客户统计 </view>
        </view>
        <view class="item" @tap="notOpen()">
          <view class="img">
            <image src="/static/images/huandianjilu.png" />
          </view>
          <view class="text"> 换电记录 </view>
        </view>
        <view class="item" @tap="notOpen()">
          <view class="img">
            <image src="/static/images/chongdianjilu.png" />
          </view>
          <view class="text"> 充电记录 </view>
        </view>
      </view>
    </view>

    <view class="my-con my-tools">
      <view class="tit">
        <view class="text"> IOT </view>
      </view>
      <view class="con-box">
        <view class="item" @tap="notOpen()">
          <view class="img">
            <image src="/static/images/services/shebeishuju_1.png" />
          </view>
          <view class="text"> 设备数据 </view>
        </view>
      </view>
    </view>
    <view class="bottom-block"> </view>
  </scroll-view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { useMemberStore } from '@/stores'
import { onLoad, onShow } from '@dcloudio/uni-app'

onShow(() => {
  const memberStore = useMemberStore()
  if (!memberStore.profile) {
    memberStore.clearProfile()
    uni.navigateTo({ url: '/pages/login/login' })
  }
})
const weixinSaomaUrl = (url: string) => {
  uni.navigateTo({
    url: url,
  })
}
const notOpen = () => {
  uni.navigateTo({ url: '/pages/detail/detail' })
}

const SendProblem = (url: string) => {
  uni.navigateTo({ url })
}
const chargeRecord = (url: string) => {
  uni.navigateTo({ url })
}

const normalyOpen = (url: string) => {
  uni.navigateTo({ url })
}
</script>
<style lang="scss">
@import './styles/category.scss';
</style>
